package com.iocup.keybastion.authorize.parser;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author xyjxust
 * @create 2022/3/2 13:57
 **/
public class DefaultAnnotationElementParserFinder implements AnnotationElementParserFinder {

    private Map<String, AnnotationElementParser> annotionElementParserMap = new ConcurrentHashMap<>();


    @Override
    public AnnotationElementParser find(String type) {
        return annotionElementParserMap.get(type);
    }

    @Override
    public AnnotationElementParserFinder addParser(AnnotationElementParser parser) {
        annotionElementParserMap.put(parser.getType(), parser);
        return this;
    }
}
